const koa = require('koa');
const serve = require('koa-static');
const chalk = require('chalk');
const path = require('path')
const app = new koa();

const HOST = "localhost"
const ROOT = "src"
const PORT = 9910; // 服务端分配端口，需与nginx配置保持一致


app

    // 静态资源访问
    .use(serve(path.join(__dirname, `/${ROOT}`)))

    // 开启端口
    .listen(PORT, () => {

        console.log(
            '\n' +
            chalk.bgGreen.black(' OPEN LINK ') +
            ' Server listening on ' +
            chalk.green(` http://${HOST}:${PORT}\n`)
        )

    });